package com.ghxxzx.dagl.utils;

import org.springframework.util.StringUtils;

/**
 * desc:
 *
 * @author cx316
 * Created by cx316 on 2020-04-17.
 */
public class NumberUtils {
    public static Double string2Double(String strVlue){
        if(StringUtils.isEmpty(strVlue)){
            return null;
        }
        Double aDouble = null;
        try {
            aDouble = Double.valueOf(strVlue);
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return aDouble;
    }
    public static Integer string2Integer(String strVlue){
        if(StringUtils.isEmpty(strVlue)){
            return null;
        }
        return Integer.valueOf(strVlue);
    }
    public static Long string2Long(String strVlue){
        if(StringUtils.isEmpty(strVlue)){
            return null;
        }
        return Long.valueOf(strVlue);
    }
}
